using System;
using System.Collections.Generic;
using System.Text;
using DDW.Collections;

namespace DDW
{
	public class ElementAccessExpression : PrimaryExpression
	{
		public ElementAccessExpression()
		{
		}
		public ElementAccessExpression(PrimaryExpression leftSide)
		{
			this.leftSide = leftSide;
		}
		public ElementAccessExpression(PrimaryExpression leftSide, ExpressionList expressions)
		{
			this.leftSide = leftSide;
			this.expressions = expressions;
		}


		private PrimaryExpression leftSide;
		public PrimaryExpression LeftSide
		{
			get { return leftSide; }
			set { leftSide = value; }
		}

		private ExpressionList expressions;
		public ExpressionList Expressions
		{
			get { return expressions; }
			set { expressions = value; }
		}

		public override void ToSource(StringBuilder sb)
		{
			leftSide.ToSource(sb);

			sb.Append("[");
			expressions.ToSource(sb);
			sb.Append("]");
		}
	}
}
